package com.mapper;

import com.javabean.Users;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UsersMapper {
    @Select("select * from users where username=#{arg0} and password=#{arg1} and status=1")
    Users selectByUsernameAndPassword(String username,String password);
    List<Users> selectAll();
    @Delete("delete from users where id=#{id}")
    int deleteById(int id);
    int insertUsers(Users users);
    @Insert("insert into users_role (userId,roleId)values(#{arg0},#{arg1})")
    int insertU_R(int usersId,int roleId);
    Users selectById(int id);
    @Update("update users set email=#{email}, username=#{username}, password=#{password}, phoneNum=#{phoneNum}, status=#{status} where id=#{id}")
    int updateUsers(Users users);
    @Update("update users_role set roleId=#{arg1} where userId=#{arg0}")
    int updateU_R(int usersId,int roleId);
}
